<!DOCTYPE html>
<html dir="<?php echo $direction; ?>" lang="<?php echo $lang; ?>">
<head>
<meta charset="UTF-8" />
<title><?php echo $title; ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base href="<?php echo $base; ?>" />
<?php if ($description) { ?>
<meta name="description" content="<?php echo $description; ?>" />
<?php } ?>
<?php if ($keywords) { ?>
<meta name="keywords" content="<?php echo $keywords; ?>" />
<?php } ?>
<?php if ($icon) { ?>
<link href="<?php echo $icon; ?>" rel="icon" />
<?php } ?>
<?php foreach ($links as $link) { ?>
<link href="<?php echo $link['href']; ?>" rel="<?php echo $link['rel']; ?>" />
<?php } ?>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/metro/stylesheet/stylesheet.css" />
<link rel="stylesheet" type="text/css" href="catalog/view/theme/metro/stylesheet/flexslider.css" />
<?php foreach ($styles as $style) { ?>
<link rel="<?php echo $style['rel']; ?>" type="text/css" href="<?php echo $style['href']; ?>" media="<?php echo $style['media']; ?>" />
<?php } ?>
<script type="text/javascript" src="catalog/view/javascript/jquery/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="catalog/view/theme/metro/js/jquery.easing-1.3.min.js"></script>
<script type="text/javascript" src="catalog/view/theme/metro/js/jquery.flexslider.js"></script>
<script type="text/javascript" src="catalog/view/javascript/jquery/ui/jquery-ui-1.8.16.custom.min.js"></script>
<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/ui/themes/ui-lightness/jquery-ui-1.8.16.custom.css" />
<script type="text/javascript" src="catalog/view/javascript/jquery/ui/external/jquery.cookie.js"></script>
<script type="text/javascript" src="catalog/view/javascript/jquery/colorbox/jquery.colorbox.js"></script>
<link rel="stylesheet" type="text/css" href="catalog/view/javascript/jquery/colorbox/colorbox.css" media="screen" />
<script type="text/javascript" src="catalog/view/javascript/jquery/tabs.js"></script>
<script type="text/javascript" src="catalog/view/javascript/common.js"></script>
<script type="text/javascript" src="catalog/view/theme/metro/js/jquery.dcjqaccordion.js"></script>
<script src="catalog/view/theme/metro/js/jquery.autocomplete.js" type="text/javascript"></script>
<script type="text/javascript" src="catalog/view/theme/metro/js/custom.js"></script>
<script type="text/javascript" src="catalog/view/theme/metro/js/cloud_zoom.js"></script>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/metro/stylesheet/jquery.autocomplete.css" />
<script type="text/javascript">
$(document).ready(function() {	
	$("#filter_name").autocomplete("getdata.php?lan=<?php echo $_SESSION['language']; ?>", {
		width: 260,
		matchContains: true,
		selectFirst: true
	});
							   
});
</script>
<?php foreach ($scripts as $script) { ?>
<script type="text/javascript" src="<?php echo $script; ?>"></script>
<?php } ?>

<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/ie7.css" />
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="catalog/view/theme/default/stylesheet/ie6.css" />
<script type="text/javascript" src="catalog/view/javascript/DD_belatedPNG_0.0.8a-min.js"></script>
<script type="text/javascript">
DD_belatedPNG.fix('#logo img');
</script>
<![endif]-->
<?php

// Load custom.css

$filename = 'catalog/view/theme/metro/stylesheet/custom.css'; 

if (file_exists($filename)) { ?>
	<link rel="stylesheet" type="text/css" href="catalog/view/theme/metro/stylesheet/custom.css" />
<?php } 

// If metro module is enabled

if($this->config->get('metro_status')== 1) {

	if($this->config->get('metro_title_font')!='' || $this->config->get('metro_body_font')!='' || $this->config->get('metro_small_font') != '' ) {
		
		$regfonts = array('Arial', 'Verdana', 'Helvetica', 'Lucida Grande', 'Trebuchet MS', 'Times New Roman', 'Tahoma', 'Georgia' );
		
		// Titles font
		if (in_array($this->config->get('metro_title_font'), $regfonts)==false) { 
			?><link href='//fonts.googleapis.com/css?family=<?php echo $this->config->get('metro_title_font') ?>&v1' rel='stylesheet' type='text/css'><?php 
		} // Body font
		if (in_array($this->config->get('metro_body_font'), $regfonts)==false) { 
			?><link href='//fonts.googleapis.com/css?family=<?php echo $this->config->get('metro_body_font') ?>&v1' rel='stylesheet' type='text/css'><?php 
		} // Small text font
		if (in_array($this->config->get('metro_small_font'), $regfonts)==false) { 
			?><link href='//fonts.googleapis.com/css?family=<?php echo $this->config->get('metro_small_font') ?>&v1' rel='stylesheet' type='text/css'>
	<?php 

		} 
	} 
?>
<style type="text/css">
body {  <?php if($this->config->get('metro_background_color')!='') {
?>  background-color: <?php echo $this->config->get('metro_background_color');
?>;
 <?php
}
 if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') $path_image = HTTPS_IMAGE;
 else $path_image = HTTP_IMAGE;
 if($this->config->get('metro_custom_image')!='') {
?>  background-image: url("<?php echo $path_image . $this->config->get('metro_custom_image') ?>");
?>;
 background-position: top center;
 background-repeat: no-repeat;
 <?php
}
else if($this->config->get('metro_custom_pattern')!='') {
?>  background-image: url("<?php echo $path_image . $this->config->get('metro_custom_pattern') ?>");
?>;
 <?php
}
else if($this->config->get('metro_pattern_overlay')!='none') {
?>  background-image: url("catalog/view/theme/metro/image/patterns/<?php echo $this->config->get('metro_pattern_overlay'); ?>.png");
 <?php
}
else { ?>  background-image: none;
 <?php
}
?>
}
<?php
 if($this->config->get('metro_theme_color')!='') {
?>
a.button, input.button, .box-product > div .cart a.button:hover, .box-product > div .cart input.button:hover, .product-grid > div .cart a.button:hover, .product-grid > div .cart input.button:hover, .product-list > div .cart a.button:hover, .product-list > div .cart input.button:hover, #header #cart.active .heading h4, #header #cart.active .heading a, .pagination .links b, #button-cart, #menu > ul > li:hover > a, #menu > ul > li > div, #header .links a, #header .button-search:hover, #menu > span.active, .flex-direction-nav .flex-next:hover, .flex-direction-nav .flex-prev:hover, .flex-control-paging li a.flex-active, .flex:hover .flex-direction-nav a:hover, .nivo-directionNav .nivo-nextNav:hover, .nivo-directionNav .nivo-prevNav:hover, .nivo-controlNav a.active, #header .links #language, #header .links #currency{
 background-color: <?php echo $this->config->get('metro_theme_color');
?>;
}
#header #welcome a:hover, #header .links:hover, #currency:hover, #language:hover, .box-product .price, .box-category > ul > li ul li a:hover, .list-item a:hover, .box-category > ul > li > ul > li a.active, .product-list .price, .product-grid .wishlist a:hover, .product-grid .compare a:hover, .product-list .wishlist a:hover, .product-list .compare a:hover, .pagination .links a:hover, .product-grid .price, .product-info .price, a.wishlist:hover, .product-info .review a:hover, .sitemap li a:hover, .breadcrumb a:hover, #menu > ul > li ul > li > a:hover, #header #welcome a, #currency:hover, #language:hover, #language ul li a:hover, #currency ul li a:hover, h1, .welcome, .product-info .cart div .wishlist:hover, a{
color:<?php echo $this->config->get('metro_theme_color');
?>;
}
.pagination .links b, .box .box-heading span{
border-color: <?php echo $this->config->get('metro_theme_color');
?>;
}
h2{
border-left-color: <?php echo $this->config->get('metro_theme_color');
?>;
}
 <?php
}
if ($this->config->get('metro_body_font') != '' ) {
			$fontpre =  $this->config->get('metro_body_font');
			$font = str_replace("+", " ", $fontpre);
		?>

		body, p { font-family:<?php echo $font ?>; }

		<?php } 
			if($this->config->get('metro_title_font')!='') {
			$fontpre =  $this->config->get('metro_title_font');
			$font = str_replace("+", " ", $fontpre);
		?>

		.welcome, h1, h2, h3, .box .box-heading, .checkout-heading, .manufacturer-heading, #menu > ul > li > a{
			font-family:<?php echo $font ?>;
		}

		<?php } ?>
</style>
<?php } ?>
<link rel="stylesheet" href="catalog/view/theme/metro/stylesheet/custom-rui.css" />
<?php echo $google_analytics; ?>
</head>
<body>
<div id="header">
<div class="header-area-1">
<?php if ($logo) { ?>
 <div id="logo"><a href="<?php echo $home; ?>"><img src="<?php echo $logo; ?>" title="<?php echo $name; ?>" alt="<?php echo $name; ?>" /></a></div>
<?php } ?>

<div class="links">
  <ul>
  <li><a class="home" href="<?php echo $home; ?>"><?php echo $text_home; ?></a></li>
  <li class="wish"><a class="wishlist" href="<?php echo $wishlist; ?>" id="wishlist-total"><?php echo $text_wishlist; ?></a></li>
  <li><a class="account" href="<?php echo $account; ?>"><?php echo $text_account; ?></a></li>
  <!--<li><a class="shopping_cart" href="<?php echo $shopping_cart; ?>"><?php echo $text_shopping_cart; ?></a></li>-->
  <li><a class="checkout" href="<?php echo $checkout; ?>"><?php echo $text_checkout; ?></a></li>
  <li><?php echo $language; ?></li>
  <li><?php echo $currency; ?></li>
  </ul>
  </div>
  <div class="clear"></div>
</div>
<div class="header-cart"><?php echo $cart; ?><div class="clear"></div></div>
<?php if ($categories) { ?>
<div id="menu">
<span>Menu</span>
  <ul>
    <?php foreach ($categories as $category) { ?>
    <li id="<?php 
    $regex = '~ {2,}~';
    $str = strtolower($category['name']);
    echo preg_replace("![^a-z0-9]+!i", "-", $str); ?>"><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
      <?php if ($category['children']) { ?>
      <div>
        <?php for ($i = 0; $i < count($category['children']);) { ?>
        <ul>
          <?php $j = $i + ceil(count($category['children']) / $category['column']); ?>
          <?php for (; $i < $j; $i++) { ?>
          <?php if (isset($category['children'][$i])) { ?>
          <li><a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a></li>
          <?php } ?>
          <?php } ?>
        </ul>
        <?php } ?>
      </div>
      <?php } ?>
    </li>
    <?php } ?>
  </ul>
  
</div>
<?php } ?>
<div class="clear"></div>
<div class="third-part">  
  <div id="welcome">
  <?php if (!$logged) { ?>
    <?php echo $text_welcome; ?>
    <?php } else { ?>
    <?php echo $text_logged; ?>
    <?php } ?>  
    </div>
        
    
  <div id="search">
    <div class="button-search"></div>
    <input type="text" name="search" id="filter_name" placeholder="<?php echo $text_search; ?>" value="<?php echo $search; ?>" />
    <!--<?php if ($filter_name) { ?>
    <input type="text" id="filter_name" name="filter_name" value="" />
    <?php } else { ?>
    <input type="text" id="filter_name" name="filter_name" value="" onClick="this.value = '';" onKeyDown="this.style.color = '#333';" />
    <?php } ?>-->
  </div>
    <div class="clear"></div>
    </div>
</div>
<div class="main-wrapper">
<div id="container">
<div id="notification"></div>